Skip to content

Comments

fix: checkout for PRs from forks#294

Merged
walkowif merged 1 commit intomainfrom
fix/checkout-for-pull-requests-from-forks
Dec 15, 2025
Merged

fix: checkout for PRs from forks#294
walkowif merged 1 commit intomainfrom
fix/checkout-for-pull-requests-from-forks

Conversation

@walkowif
Copy link
Contributor

@walkowif walkowif commented Dec 15, 2025

This fixes an issue where the latest commit from a PR is not checked out properly (in build-check-install.yaml workflow) for PRs coming from forks.

This also makes the build-check-install.yaml workflow consistent with the others which already use the ref: ${{ steps.branch-name.outputs.head_ref_branch }} input in a similar way.

Setup

Assuming this is the latest commit on main:

image

These are the commits in PR not from fork:

image

These are the commits in PR from fork:

image

Old settings

Running for PR not from fork: main is correctly merged with latest PR commit

image

Running for PR from fork: main is checked out (not correct)

image

Cause

This is likely because in a fork, the default branch is checked out by default if ref input is not provided:
https://github.com/actions/checkout/blob/v4.1.1/action.yml#L7-L11

New settings

Running for PR not from fork: main is correctly merged with latest PR commit

image

Running for PR from fork: main is also correctly merged with latest PR commit

image

@walkowif walkowif marked this pull request as ready for review December 15, 2025 09:42
@walkowif walkowif requested a review from a team as a code owner December 15, 2025 09:42
@github-actions
Copy link
Contributor

Unit Tests Summary

3 tests   2 ✅  4s ⏱️
3 suites  1 💤
1 files    0 ❌

Results for commit c3e87dc.

Copy link
Contributor

@pawelru pawelru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@walkowif walkowif merged commit d42171e into main Dec 15, 2025
49 checks passed
@walkowif walkowif deleted the fix/checkout-for-pull-requests-from-forks branch December 15, 2025 09:57
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants